import Head from 'next/head'

import React, { JSX } from 'react'


type propsType ={
  title?: string
  desc?: string
  css?: string
  js?: string
  children: JSX.Element | JSX.Element[]
}

export default function PageWrapper(props: propsType) {
  const {title='',desc='',css='',js='',children} = props
  return (
    <>
    <Head>
      <title>{title}</title>
      <meta name='description' content={desc}></meta>
      <meta name='viewport' content='width=device-width, initial-scale=1'></meta>
      <link rel="icon" href="/favicon.ico" />
      <style>{css}</style>
    </Head>
    <main>{children}</main>
    <script id="page-js">{js}</script>
    </>
  )
}
